// 引入 mongoose 模块
const mongoose = require('mongoose')

// 创建文档的结构对象
const UserSchema = new mongoose.Schema({
    username: {
        type: String,
        required: true,
    },
    password: {
        type: String,
        required: true,
    }
})

// 创建模型对象 对文档操作额封装
const UserModel = mongoose.model('user', UserSchema)

// 导出模型对象
module.exports = UserModel
